import Vue from 'vue';
import iView from 'iview';
import {router} from './router/index';
// import {appRouter} from './router/router';
import store from './store';
import importDirective from '@/directive'
import App from './app.vue';
import 'iview/dist/styles/iview.css';
import Promise from 'es6-promise'
// import './views/main.less'
import vueToPdf from '@/libs/vueToPdf'
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.snow.css'
import QRCode from 'qrcodejs2'
Promise.polyfill()
import echarts from "echarts"
Vue.prototype.$echarts = echarts
Vue.use(iView);
Vue.use(VueQuillEditor)
Vue.use(vueToPdf)

/* 引入elementUI */
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

/* antv */
import G2 from '@antv/g2'
Vue.use(G2)

// npm install --save-dev babel-polyfill
import 'babel-polyfill'

/**
 * 注册指令
 */
importDirective(Vue)
// Vue.use(BaiduMap, {
//     // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
//     ak: 'piXQ5CgHFqEefqCVbhhBFfe6HjF7l4zW'
// })

new Vue({
    el: '#app',
    router: router,
    store: store,
    render: h => h(App),
    data: {
        currentPageName: ''
    },
    mounted () {
        // this.currentPageName = this.$route.name;
        // // 显示打开的页面的列表
        // this.$store.commit('setOpenedList');
        // this.$store.commit('initCachepage');
        // // 权限菜单过滤相关
        // this.$store.commit('updateMenulist');
        // iview-admin检查更新

    },
    created () {
        // let tagsList = [];
        // appRouter.map((item) => {
        //     if (item.children.length <= 1) {
        //         tagsList.push(item.children[0]);
        //     } else {
        //         tagsList.push(...item.children);
        //     }
        // });
        // this.$store.commit('setTagsList', tagsList);
    }
});
